package com.songshuai.webapi.baseapi.service.impl;

import com.songshuai.webapi.baseapi.dao.CityDao;
import com.songshuai.webapi.baseapi.model.YixueBaseCity;
import com.songshuai.webapi.baseapi.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CityServiceImpl implements CityService {

    @Autowired
    private CityDao cityDao;

    //@Cacheable(cacheNames = "cityName",key = "#cityId",unless="#result == null")
    @Override
    public String getCityName(Integer cityId) {
        String retData="";
        if(cityId==null||cityId<=0){
            return  retData;
        }
        YixueBaseCity city=cityDao.getCityById(cityId);
        if(city!=null){
            retData=city.getCity_name();
        }
        return retData;
    }
}
